home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#)datadesc.h 1.6 4/11/88
- */
- #ifndef datadesc_h
- #define datadesc_h
-
- #ifndef addresses_h
- #include "addresses.h"
- #endif
-
- #ifndef types_h
- #include "types.h"
- #endif
-
- #ifndef ecTypes_h
- #include "ecTypes.h"
- #endif
-
- typedef enum { R_Temporary, R_Allocatable, R_Linkage} RegisterKinds;
-
- typedef enum { DD_Address, DD_Manifest, DD_PSLCondition, DD_AbCon,
- DD_OIDToODP, DD_OIDToODAP, DD_OIDToCodePtr, DD_Label, DD_Self,
- DD_RealManifest } DD_Kind;
- typedef enum { NEQ, EQL, GTR, LEQ, GEQ, LSS,
- GTRU, LEQU, VC, VS, GEQU, LSSU, PL, MI, ALWAYS, SUBR } PSLCondition;
-
- #define NEQU NEQ
- #define EQLU EQL
- #define CC GEQU
- #define CS LSSU
-
- extern PSLCondition negatedConditions[];
- extern PSLCondition reversedConditions[];
- extern char *PSLConditionName[];
- #define JN(S) PSLConditionName[(int)(S)]
- #define JF(S) ((S) ? FLOATJUMPCHAR : "")
- #define TS_Stack 1
- #define TS_PSL 2
- #define TS_Self 4
- #define TS_Label 8
- #define TS_All 15
-
- typedef struct sDataDescriptor {
- DD_Kind kind:8;
- unsigned int ATOID:24;
- union {
- Address address;
- int manifest;
- char *realmanifest;
- struct {
- PSLCondition psl:16;
- Boolean isFloat:16;
- } condition;
- OID CTOID;
- OID id;
- int label;
- } value;
- } DD, *DDPtr;
-
- #define getDDAbstractType(X) ((OID) ((X).ATOID | 0xff000000))
- #define getDDConcreteType(X) ((OID) (X).value.CTOID)
-
- #define setDDAbstractType(X, ID) ((X).ATOID = (ID) & ~0xff000000)
- #define setDDConcreteType(X, ID) ((X).value.CTOID = (ID))
-
- typedef struct Variable {
- DD data;
- DD abCon;
- } Variable, *VariablePtr;
-
- extern Variable vStack[];
- extern VariablePtr vStackTop;
- extern void vForceToTemp();
- extern void vPush(), vPushSymbol(), vSwap(), vGenerateAssign(), vPushValue(),
- vPushVariable(), ddGenerateAssign(), vPushDD(), vPushOwnName(),
- vPushOwnType();
- extern DD vGetSymbolAbCon();
- extern Variable vPop(), vTop();
- extern DD vPopData(), vPopAbCon();
- extern DD vTopData(), vTopAbCon();
- extern Boolean vEmpty();
- extern Variable *vPeek();
- extern void vDiscard(), vDiscardN();
- extern DD nextAddress();
- extern Boolean isNextAddress(), isSameDD();
- extern int allocateReg();
- extern void claimReg();
- extern void freeAllRegs(), freeReg(), preemptReg(), preemptKernelRegisters();
- extern void TS_startOperation(), TS_endOperation(), TS_Free();
- extern int TS_Allocate();
- extern void TS_StartInvocation(), TS_Results(), TS_Push(), TS_EndInvocation(),
- TS_fixSPForHandler();
- /*
- * Contexts for generating expressions. Basically, there are times when we
- * want to take advantage of context information. Such as puting the result
- * of an invocation in the right place, generating psl conditions in a
- * branching context, etc.
- */
-
- typedef enum { C_Any, C_PSL, C_Variable } ContextKind;
-
- typedef struct Context {
- ContextKind kind;
- Variable v;
- } Context, *ContextPtr;
-
- extern Context anyContext, pslContext, pusherContext;
-
- #endif
-